package myenum;

import java.util.Set;

public enum PayrollDay {
    MONDAY,TUESDAY,WEDNEDDAY,THURSDAY,FRIDAY,
    SATURDAY(PayType.WEEKEND),SUNDAY(PayType.WEEKEND), WEEKEND;
    private final PayType payType;

    PayrollDay(PayType payType){
        this.payType = payType;
    }
    PayrollDay(){
        this(PayType.WEEKDAY);
    }

    int pay(int minsWorked,int payRate) {
        return payType.pay(minsWorked, payRate);
    }


    enum PayType{
        WEEKDAY{
            int overtimePay(int minsWorked,int payRate) {
                return minsWorked <= MINS_PER_SHIFT ? 0:
                        (minsWorked - MINS_PER_SHIFT) * payRate / 2;
            }
        },
        WEEKEND{
            int overtimePay(int minsWorked,int payRate) {
                return minsWorked * payRate / 2;
            }
        };

        abstract int overtimePay(int mins,int payRate);
        private static final int MINS_PER_SHIFT = 8 * 60;

        int pay(int minsWorked,int payRate) {
            int basePay = minsWorked * payRate;
            return basePay + overtimePay(minsWorked,payRate);
        }

    }

}
class www{
    public enum Style{BOLB,ITALIC}

    public void applyStyles(Set<Style> styles){

        styles.add(Style.BOLB);
    }
    public static void main(String[] args) {
        System.out.println(PayrollDay.FRIDAY.pay(1,1));
    }
}